﻿package  Classes{
	
	public class Coordinate {

	public var x:int;
	public var y:int;
	public var value:int;
	public var parent:Coordinate = null; // 为A*寻路使用

	public function Coordinate(coordinate:int) {
		this.x = coordinate % 100;
		this.y = coordinate / 100;
		this.value = coordinate;
	}
	
	public function CoordinateValue(coordinate:int) {
		this.x = coordinate % 100;
		this.y = coordinate / 100;
		this.value = coordinate;
	}
	
	public function CoordinateXY(x:int, y:int):void {
		this.x = x;
		this.y = y;
		this.value = 100 * y + x;
	}

	public function  equals(c:Coordinate):Boolean {
		return this.value == c.value;
	}

	}
	
}
